package com.xingzhi.shortvideosharingplatform.service.impl;

import com.xingzhi.shortvideosharingplatform.dto.VideoDTO;
import com.xingzhi.shortvideosharingplatform.entity.Video;
import com.xingzhi.shortvideosharingplatform.mapper.VideoMapper;
import com.xingzhi.shortvideosharingplatform.service.IVideoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xingzhi.shortvideosharingplatform.vo.VideoVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 视频信息表 服务实现类
 * </p>
 *
 * @author zjw
 * @since 2025-06-17
 */
@Service
public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements IVideoService {

    @Resource
    private VideoMapper videoMapper;

    @Override
    public List<VideoVO> selectVideoList(Integer offset, Integer pageSize) {
        return videoMapper.selectAllVideos(offset, pageSize);
    }

    @Override
    public VideoVO getVideoById(Long videoId) {
        return videoMapper.selectVideoDetailById(videoId);
    }
}
